<?php
	session_start();
	require("connect.php");
	$link = connect_APO();

	$midweekName=$_GET['midweek_name'];
	
	$sql = sprintF("SELECT * From midweeks WHERE Name='$midweekName'");
	$result = mysql_query($sql);
	$row = mysql_fetch_array($result);
	
	$midweekStartTime=$row["StartTime"];
	$midweekEndTime=$row["EndTime"];
	$midweekDay=$row["Day"];
	$midweekCredit=$row["Credit"];
	$midweekLeader1=$row["Leader1"];
	$midweekLeader2=$row["Leader2"];
	$midweekMaxSlots=$row["MaxPeople"];
	
	if($_SESSION['ID'] != $midweekLeader1 && $_SESSION['ID'] != $midweekLeader2 && $_SESSION['type'] != "admin"){
		// If they are not a midweek leader or the coordinator then redirect them
		header('Location: login.php');
	}
	
	require("header+logoutB.php");
	headerL();
	
	
	require("footer.php");
	footer();
	
	mysql_close($link);
?>